package com.mao.jxc.admin.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 * @author: Administrator
 * @description:
 * @cteate 2021-07-20-16:20
 */
@Controller
public class MainController {

    @RequestMapping("/index")
    public String index(){
        return "index";
    }

    @RequestMapping("/main")
    public String main(){
        return "main";
    }

    @RequestMapping("/welcome")
    public String welcome(){
        return "welcome";
    }

    /**
     * 用户登出方法
     * @param session
     * @return
     */
    @RequestMapping("/signout")
    public String signout(HttpSession session){
        session.removeAttribute("user");
        return "redirect:/index";
    }

}

